package twentyOne;

/**
 * 练习1
 *
 * @author MSI PC
 * @since 2020-04-22 18:24
 */
public class exercise01 {

    public static void main(String[] args) {
        for (int i = 0; i < 5 ; i++) {
            new Thread(new MyRun()).start();
        }
    }

}


class MyRun implements Runnable{

    private static int taskCount;
    private final int id = taskCount++;

    public MyRun() {
        System.out.println("MyRun No." + id);
    }

    @Override
    public void run() {
        for (int i = 0; i < 3 ; i++) {
            System.out.println("this is my run-" + id + "," + i );
//            Thread.yield();
        }
    }
}